ANU BDSI
workshop Data Visualisation with R Part 1
Biological Data Science Institute
10th April 2024
ggplot2
ggplot2
ggplot2ggplotdata.frame
geom_histogram()geom_density()stat_ecdf()stat_qq()geom_boxplot()geom_violin()geom_jitter()penguins data is from the palmerpenguins 📦
geom_histogram()geom layers in ggplot2stat layers in ggplot2
geom_point()geom_smooth()geom_bin2d()geom_hex()geom_line()vignette("ggplot2-specs")
?geom_point).x and y
alpha
color
fill
size
geom_point()shape
stroke vs size
stroke and fill is only for the “filled” shapes.color
linetype
linewidth
lineend
linejoin
aes, it assumes that it’s a data variable."dodgerblue" gets converted into a variable with one level and it gets colored by ggplot’s default color palette.Don’t put attributes inside aes()!
I() operator to mean “as-is” in aesthetic mapping.ggplot() but not attributes.30:00 anu-bdsi.github.io/workshop-data-vis-R1/